let $toFixed = function(val, acc) {
    let num = parseFloat(val)
    if (isNaN(num)) {
      num = 0
    }
    let accuracy = parseInt(acc)
    if (isNaN(accuracy) || accuracy < 0 || accuracy > 10) {
      accuracy = 2
    }
    return num.toFixed(accuracy)
  }

  export default {
    $toFixed
  }
